package com.company.OfferGuide;

public class 合并排序的数组 {

    public void merge(int[] A, int m, int[] B, int n) {
        int k = m + n - 1, i = m - 1, j = n - 1;
        while (i >=0 && j >= 0) {
            if (B[j] > A[i]) {
                A[k--] = B[j--];
            } else {
                A[k--] = A[i--];
            }
        }
        while (j >=0 ) A[k--] = B[j--];
    }

}
